﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls;
using Acms.Bll;

namespace Acms.AcmsControls.ContentControls.Admin
{
    public class TrueFalseAdminEdit : BaseAdminEdit<TrueFalseContentControlProperties>
    {
        protected override string GetCssClass
        {
            get { return "truefalse"; }
        }

        private CheckBox value = new CheckBox();

        protected override void CreateChildControls()
        {
            this.Controls.Add(value);
            base.CreateChildControls();
        }

        protected override void SaveToProperties(TrueFalseContentControlProperties properties, PostControl control)
        {
            if (properties != null)
            {
                properties.Value = value.Checked;
            }
        }

        public override void PropertiesLoaded(TrueFalseContentControlProperties properties)
        {
            if (properties != null)
            {
                value.Checked = properties.Value;
            }
        }
    }
}
